<?php
//递归获取无限分类
function getCateByPid($pid=0){
	global $mysql;
	$sql ="SELECT * FROM category WHERE status=1 and pid={$pid};";
	$result = $mysql->getAll($sql);
	if(!empty($result)){
		foreach ($result as $key => $value) {
			$result[$key]['child']=getCateByPid($value['id']);
		}
	}
	return $result;
}

//获取单个系统配置
function get_config($key){
	global $mysql;
	$sql = "SELECT settingvalue FROM setting WHERE settingkey='{$key}';";
	$value = $mysql->getOne($sql);
	return $value;
}